<?php

declare(strict_types=1);
/**
 * Third-party RocketMQ Client SDK for Hyperf
 *
 * @contact colisys@duck.com
 * @license MIT
 * @copyright 2025 Colisys
 */

namespace Colisys\Rocketmq\Remoting;

enum ResponseCode: int
{
    case SUCCESS = 0;
    case SYSTEM_ERROR = 1;
    case SYSTEM_BUSY = 2;
    case REQUEST_CODE_NOT_SUPPORTED = 3;
    case TRANSACTION_FAILED = 4;
    case FLUSH_DISK_TIMEOUT = 10;
    case SLAVE_NOT_AVAILABLE = 11;
    case FLUSH_SLAVE_TIMEOUT = 12;
    case MESSAGE_ILLEGAL = 13;
    case SERVICE_NOT_AVAILABLE = 14;
    case VERSION_NOT_SUPPORTED = 15;
    case NO_PERMISSION = 16;
    case TOPIC_NOT_EXIST = 17;
    case TOPIC_EXIST_ALREADY = 18;
    case PULL_NOT_FOUND = 19;
    case PULL_RETRY_IMMEDIATELY = 20;
    case PULL_OFFSET_MOVED = 21;
    case QUERY_NOT_FOUND = 22;
    case SUBSCRIPTION_PARSE_FAILED = 23;
    case SUBSCRIPTION_NOT_EXIST = 24;
    case SUBSCRIPTION_NOT_LATEST = 25;
    case SUBSCRIPTION_GROUP_NOT_EXIST = 26;
    case FILTER_DATA_NOT_EXIST = 27;
    case FILTER_DATA_NOT_LATEST = 28;
    case INVALID_PARAMETER = 29;
    case TRANSACTION_SHOULD_COMMIT = 200;
    case TRANSACTION_SHOULD_ROLLBACK = 201;
    case TRANSACTION_STATE_UNKNOW = 202;
    case TRANSACTION_STATE_GROUP_WRONG = 203;
    case NO_BUYER_ID = 204;
    case NOT_IN_CURRENT_UNIT = 205;
    case CONSUMER_NOT_ONLINE = 206;
    case CONSUME_MSG_TIMEOUT = 207;
    case NO_MESSAGE = 208;
    case POLLING_FULL = 209;
    case POLLING_TIMEOUT = 210;
    case BROKER_NOT_EXIST = 211;
    case BROKER_DISPATCH_NOT_COMPLETE = 212;
    case BROADCAST_CONSUMPTION = 213;
    case FLOW_CONTROL = 215;
    case NOT_LEADER_FOR_QUEUE = 501;
    case ILLEGAL_OPERATION = 604;
    case RPC_UNKNOWN = -1000;
    case RPC_ADDR_IS_NULL = -1002;
    case RPC_SEND_TO_CHANNEL_FAILED = -1004;
    case RPC_TIME_OUT = -1006;
    case GO_AWAY = 1500;

    // Controller response codes
    case CONTROLLER_FENCED_MASTER_EPOCH = 2000;
    case CONTROLLER_FENCED_SYNC_STATE_SET_EPOCH = 2001;
    case CONTROLLER_INVALID_MASTER = 2002;
    case CONTROLLER_INVALID_REPLICAS = 2003;
    case CONTROLLER_MASTER_NOT_AVAILABLE = 2004;
    case CONTROLLER_INVALID_REQUEST = 2005;
    case CONTROLLER_BROKER_NOT_ALIVE = 2006;
    case CONTROLLER_NOT_LEADER = 2007;
    case CONTROLLER_BROKER_METADATA_NOT_EXIST = 2008;
    case CONTROLLER_INVALID_CLEAN_BROKER_METADATA = 2009;
    case CONTROLLER_BROKER_NEED_TO_BE_REGISTERED = 2010;
    case CONTROLLER_MASTER_STILL_EXIST = 2011;
    case CONTROLLER_ELECT_MASTER_FAILED = 2012;
    case CONTROLLER_ALTER_SYNC_STATE_SET_FAILED = 2013;
    case CONTROLLER_BROKER_ID_INVALID = 2014;
    case CONTROLLER_JRAFT_INTERNAL_ERROR = 2015;
    case CONTROLLER_BROKER_LIVE_INFO_NOT_EXISTS = 2016;
    case USER_NOT_EXIST = 3001;
    case POLICY_NOT_EXIST = 3002;
}
